import { createRouter, createWebHistory } from 'vue-router'
import Index from '../views/index.vue'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Index
  },
  {
    path: '/article',
    component: () => import ('../views/article.vue')
  },
  {
    path: '/tools',
    component: () => import ('../views/tools.vue')
  },
  {
    path: '/messageBoard',
    component: () => import ('../views/messageBoard.vue')
  },
  {
    path: '/life',
    component: () => import ('../views/life.vue')
  },
  {
    path: '/about',
    component: () => import ('../views/about.vue')
  }
  ,
  {
    path: '/detail/:id',
    component: () => import ('../views/articleDetail.vue')
  }
  ,
  {
    path: '/404',
    name: "notFound",
    component: () => import ('../404.vue')
  },
  {
    path: '/:catchAll(.*)',
    redirect: '/404'
  }
]
const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
